/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pegscrn.hpp - PegScreen driver example. This screen driver does
//               not configure hardware, therefore it will not work
//               with any LCD controller. It is included as a starting
//               point for user who would like to create their own driver.
//
// Author: Craig Johnson
//
// Copyright (c) 1997-2008 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _pegscrn_
#define _pegscrn_

#if (PEG_NUM_COLORS == 0x7ffffff)
 // include 32 bit template class
 #include "l32scrn.hpp"
 #define SCRN_TEMPLATE      L32Screen
 #define PEG_BPP            32

#elif (PEG_NUM_COLORS == 0xffffff)
 // include 24 bit template class
 #include "l24scrn.hpp"
 #define SCRN_TEMPLATE      L24Screen
 #define PEG_BPP            24
  
#elif (PEG_NUM_COLORS == 65535)
 // include 16 bit template class
 #include "l16scrn.hpp"
 #define SCRN_TEMPLATE      L16Screen
 #define PEG_BPP            16
 
#elif (PEG_NUM_COLORS == 256)
 // include 8 bit template class
 #include "l8scrn.hpp"
 #define SCRN_TEMPLATE      L8Screen
 #define PEG_BPP            8 

#endif

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PEGScreenDriver : public SCRN_TEMPLATE
{
    public:
        PEGScreenDriver(const PegRect &);
        virtual ~PEGScreenDriver();
        virtual void ConfigureController(void);
        virtual PEGUBYTE *GetVideoAddress(void);
        virtual void InitHardwareSurface(PEGINT Width, PEGINT Height,
            DrawSurface *pSurface, PEGINT HardLayer);

    protected:
        virtual void MemoryToScreen(void);

       #if (PEG_NUM_COLORS <= 256)
        virtual void SetPalette(PEGINT First, PEGINT Count, 
                                const PEGUBYTE *pGet);
       #endif

    private:

        PEGUBYTE *mpVidMemBase;        

};


#endif
